﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataObjects;
using DataObjects.Interfaces;
using Service.DataTransferObjects;

namespace Service
{
    // Facade Pattern
    public class CustomerService
    {
        private static readonly ICustomerDao CustomerDao = DataAccess.CustomerDao;

        public CustomerDTO GetCustomer(string customerId)
        {
            var customer = Mapper.ToDataTransferObject(CustomerDao.GetCustomer(customerId));

            return customer;
        }

        public void InsertCustomer(CustomerDTO customer)
        {
            CustomerDao.InsertCustomer(Mapper.FromDataTransferObject(customer));
        }
    }
}
